/***
 * 弹出窗口路由全局变量，目前只支持单个窗口弹出
 * path 路径
 * component 需要显示的组件/页面
 * info 相关信息
 * 
 * 
 * 展示窗口入口 在Layout/components/AppMain.vue中
 * 赋值在U.vue中
 */
const state = {
    path:null,
    component:null,
    info:null
  }
  const mutations = {
      setPath(state,path){
        state.path=path;
      },
      clearPath(state){
        state.path=null;
        this.component=null;
      },
      getPath(state){
          return state.path;
      },
      setComponent(state,component){
        state.component=component;
      },
      getComponent(state){
       return state.component;
      },
      setInfo(state,info){
        state.info=info;
      },
      getInfo(state){
       return state.info;
      },
      setRouter(state,param){
        state.path=param[0];
        state.component=param[1];
        state.info=param[2];
      }
  }
  const actions = {
    setPath({commit},path){
        commit("setPath",path)
    },
    clearPath({commit}){
        commit("clearPath")
    },
    getPath({commit}){
        commit("getPath")
    },
    getComponent({commit}){
      commit("getComponent")
    },
    setComponent({commit},component){
        commit("setComponent",component)
    },
    setRouter({commit},param){
      commit("setRouter",param)
    }
}
export default {
    namespaced: true,
  state,
  mutations,
  actions
}